package com.UnionPayCenter.service;

import com.UnionPayCenter.entity.ShopCardInfoEntity;
import com.UnionPayCenter.entity.ShopEntity;
import com.UnionPayCenter.entity.ShopInfoEntity;
import com.UnionPayCenter.entity.UserLevelEntity;
import com.UnionPayCenter.entity.vo.ShopInfoVo;
import com.UnionPayCenter.entity.vo.ShopLinkVo;
import com.UnionPayCenter.shop.request.ShopUpdateRequest;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;

import java.io.IOException;
import java.util.List;

public interface IShopService {
    /**
     * @Description: 创建商铺
     * @Param:
     * @return:
     * @Author: bite
     * @Date: 2019/6/20
     */
    Integer create(JSONObject jsonParam);

    /**
     * @Description: 查询商铺
     * @Param:
     * @return:
     * @Author: bite
     * @Date: 2019/6/20
     */
    ShopEntity findShop(JSONObject jsonParam);

    /**
     * @Description: 修改商铺信息
     * @Param:
     * @return:
     * @Author: bite
     * @Date: 2019/6/20
     */
    boolean update(JSONObject jsonParam);

    /**
     * @Description: 查询商铺连接
     * @Param:
     * @return:
     * @Author: bite
     * @Date: 2019/6/20
     */
    ShopLinkVo findLink(JSONObject jsonParam);

    /**
     * @Description: 前端查询商铺信息
     * @Param:
     * @return:
     * @Author: bite
     * @Date: 2019/6/20
     */
    ShopEntity getShop(JSONObject jsonParam);

    /**
     * @Description: 查询商铺列表
     * @Param:
     * @return:
     * @Author: bite
     * @Date: 2019/6/20
     */
    List<ShopEntity> findList(JSONObject jsonParam);

    ShopInfoVo findShopInfo(JSONObject jsonParam);

    boolean updateShopInfo(JSONObject jsonParam);

    boolean updateShopInfo(ShopUpdateRequest shopUpdateRequest) throws Exception;


    /**
     * 更新店铺信息
     *
     * @param shopInfoEntity 店铺信息
     * @return
     */
    void updateShopInfo(ShopInfoEntity shopInfoEntity);

    /**
     * @Description: 微信支付获取商铺配置
     * @Param: shopId：商铺id
     * @return:
     * @Author: bite
     * @Date: 2019/6/1
     */
    ShopInfoEntity wechatPayGetShopInfo(Integer shopId);

    ShopInfoEntity wechatGetShopInfo(Integer shopId);

    /**
     * @Description: 小程序代码根据商铺打包
     * @Param:
     * @return:
     * @Author: bite
     * @Date: 2019/6/10
     */
    String download(JSONObject jsonParam) throws Exception;

    ShopInfoEntity getByCardId(String cardId);

    /**
     * @Description: 小程序获取支付方式
     * @Param:
     * @return:
     * @Author: bite
     * @Date: 2019/6/29
     */
    Integer getPayChannel(JSONObject jsonParam);

    /**
     * @Description: 获取商铺卡券配置
     * @Param:
     * @return:
     * @Author: bite
     * @Date: 2019/7/9
     */
    ShopCardInfoEntity wechatGetShopCardInfo(Integer shopId);

    boolean updateShopCardId(int shopId, String cardId);

    /**
     * @Description: 获取开卡组件参数
     * @Param:
     * @return:
     * @Author: bite
     * @Date: 2019/7/10
     */
    JSONObject getCardActivate(JSONObject jsonParam);

    /**
     * @Description: 获取会员卡信息
     * @Param:
     * @return:
     * @Author: bite
     * @Date: 2019/7/14
     */
    ShopCardInfoEntity getCardInfo(JSONObject jsonParam);

    /**
     * @Description: 获取会员卡列表
     * @Param:
     * @return:
     * @Author: bite
     * @Date: 2019/7/14
     */
    PageInfo<ShopCardInfoEntity> getCardList(JSONObject jsonParam);

    ShopCardInfoEntity createCard(JSONObject jsonParam);

    ShopCardInfoEntity updateCard(JSONObject jsonParam);

    /**
     * @Description: 根据appid查询商铺
     * @Param:
     * @return:
     * @Author: bite
     * @Date: 2019/7/31
     */
    ShopInfoEntity getByAppid(String authorizerAppid);

    /**
     * 获取店铺会员的初始等级信息
     *
     * @param shopId 店铺id
     * @return 会员等级信息
     */
    UserLevelEntity getShopInitialMemberLevel(Integer shopId);
}
